#ifndef _CHAR_DEV_H
#define _CHAR_DEV_H

struct char_dev {
	struct device dev;
	unsigned int type;
};

struct char_dev_operations {
	int (*open)(struct device *dev, unsigned int flags);
	int (*close)(struct device *dev);
	int (*read)(struct device *dev, void *buf, unsigned int len);
	int (*write)(struct device *dev, const void *buf, unsigned int len);
    loff_t (*llseek)(struct device *dev, loff_t offset, unsigned int origin); 
	int (*ioctl)(struct device *dev, unsigned int cmd, unsigned int arg);
};

struct char_dev_driver {
	struct driver drv;
	unsigned int type;
	struct char_dev_operations *char_dev_ops;
};

#endif /* _CHAR_DEV_H */

